<!DOCTYPE html>



  


<html class="theme-next pisces use-motion" lang="zh-Hans">
<head>
  <meta charset="UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1"/>
<meta name="theme-color" content="#222">




<script>
    (function(){
        if(''){
            if (prompt('请输入文章密码') !== ''){
                alert('密码错误！');
                history.back();
            }
        }
    })();
  </script>






<meta http-equiv="Cache-Control" content="no-transform" />
<meta http-equiv="Cache-Control" content="no-siteapp" />
















  
  
  <link href="/lib/fancybox/source/jquery.fancybox.css?v=2.1.5" rel="stylesheet" type="text/css" />







<link href="/lib/font-awesome/css/font-awesome.min.css?v=4.6.2" rel="stylesheet" type="text/css" />

<link href="/css/main.css?v=5.1.4" rel="stylesheet" type="text/css" />



  <link rel="icon" type="image/png" sizes="32x32" href="/favicon.ico?v=5.1.4">







  <meta name="keywords" content="Swift," />





  <link rel="alternate" href="/atom.xml" title="Swift社区" type="application/atom+xml" />






<meta name="description" content="周报仓库：https://github.com/SwiftCommunityRes 前言最近 Swift.org 进行了一些非常好的改进，包括对 dark mode 的支持。 对于在 iOS 上使用 dark mode 的用户，该网站将自动切换模式以匹配。  为了 Swift 社区周报持续稳定的发布更新，我们希望邀请 Swift 爱好者参与周报编辑，同时邀请赞助商对我们平台赞助支持。">
<meta name="keywords" content="Swift">
<meta property="og:type" content="article">
<meta property="og:title" content="Swift 周报 第四期">
<meta property="og:url" content="https://fanbaoying.github.io/Swift-周报-第四期/index.html">
<meta property="og:site_name" content="Swift社区">
<meta property="og:description" content="周报仓库：https://github.com/SwiftCommunityRes 前言最近 Swift.org 进行了一些非常好的改进，包括对 dark mode 的支持。 对于在 iOS 上使用 dark mode 的用户，该网站将自动切换模式以匹配。  为了 Swift 社区周报持续稳定的发布更新，我们希望邀请 Swift 爱好者参与周报编辑，同时邀请赞助商对我们平台赞助支持。">
<meta property="og:locale" content="zh-Hans">
<meta property="og:image" content="https://user-images.githubusercontent.com/24238160/132703149-34121c6c-fd18-491c-a697-58a0fabf3060.png">
<meta property="og:image" content="https://files.mdnice.com/user/17787/9a7911bf-75f2-40f5-866b-3171868bb92c.jpg">
<meta property="og:updated_time" content="2021-10-22T07:20:03.000Z">
<meta name="twitter:card" content="summary">
<meta name="twitter:title" content="Swift 周报 第四期">
<meta name="twitter:description" content="周报仓库：https://github.com/SwiftCommunityRes 前言最近 Swift.org 进行了一些非常好的改进，包括对 dark mode 的支持。 对于在 iOS 上使用 dark mode 的用户，该网站将自动切换模式以匹配。  为了 Swift 社区周报持续稳定的发布更新，我们希望邀请 Swift 爱好者参与周报编辑，同时邀请赞助商对我们平台赞助支持。">
<meta name="twitter:image" content="https://user-images.githubusercontent.com/24238160/132703149-34121c6c-fd18-491c-a697-58a0fabf3060.png">



<script type="text/javascript" id="hexo.configurations">
  var NexT = window.NexT || {};
  var CONFIG = {
    root: '/',
    scheme: 'Pisces',
    version: '5.1.4',
    sidebar: {"position":"left","display":"post","offset":12,"b2t":false,"scrollpercent":false,"onmobile":false},
    fancybox: true,
    tabs: true,
    motion: {"enable":true,"async":false,"transition":{"post_block":"fadeIn","post_header":"slideDownIn","post_body":"slideDownIn","coll_header":"slideLeftIn","sidebar":"slideUpIn"}},
    duoshuo: {
      userId: '0',
      author: '博主'
    },
    algolia: {
      applicationID: '',
      apiKey: '',
      indexName: '',
      hits: {"per_page":10},
      labels: {"input_placeholder":"Search for Posts","hits_empty":"We didn't find any results for the search: ${query}","hits_stats":"${hits} results found in ${time} ms"}
    }
  };
</script>



  <link rel="canonical" href="https://fanbaoying.github.io/Swift-周报-第四期/"/>





  <title>Swift 周报 第四期 | Swift社区</title>
  








</head>

<body itemscope itemtype="http://schema.org/WebPage" lang="zh-Hans">

  
  
    
  

  <div class="container sidebar-position-left page-post-detail">
    <div class="headband"></div>
    
    <a href="https://github.com/SwiftCommunityRes" class="github-corner" aria-label="View source on GitHub"><svg width="80" height="80" viewBox="0 0 250 250" style="fill:#151513; color:#fff; position: absolute; top: 0; border: 0; right: 0;" aria-hidden="true"><path d="M0,0 L115,115 L130,115 L142,142 L250,250 L250,0 Z"></path><path d="M128.3,109.0 C113.8,99.7 119.0,89.6 119.0,89.6 C122.0,82.7 120.5,78.6 120.5,78.6 C119.2,72.0 123.4,76.3 123.4,76.3 C127.3,80.9 125.5,87.3 125.5,87.3 C122.9,97.6 130.6,101.9 134.4,103.2" fill="currentColor" style="transform-origin: 130px 106px;" class="octo-arm"></path><path d="M115.0,115.0 C114.9,115.1 118.7,116.5 119.8,115.4 L133.7,101.6 C136.9,99.2 139.9,98.4 142.2,98.6 C133.8,88.0 127.5,74.4 143.8,58.0 C148.5,53.4 154.0,51.2 159.7,51.0 C160.3,49.4 163.2,43.6 171.4,40.1 C171.4,40.1 176.1,42.5 178.8,56.2 C183.1,58.6 187.2,61.8 190.9,65.4 C194.5,69.0 197.7,73.2 200.1,77.6 C213.8,80.2 216.3,84.9 216.3,84.9 C212.7,93.1 206.9,96.0 205.4,96.6 C205.1,102.4 203.0,107.8 198.3,112.5 C181.9,128.9 168.3,122.5 157.7,114.1 C157.9,116.9 156.7,120.9 152.7,124.9 L141.0,136.5 C139.8,137.7 141.6,141.9 141.8,141.8 Z" fill="currentColor" class="octo-body"></path></svg></a><style>.github-corner:hover .octo-arm{animation:octocat-wave 560ms ease-in-out}@keyframes octocat-wave{0%,100%{transform:rotate(0)}20%,60%{transform:rotate(-25deg)}40%,80%{transform:rotate(10deg)}}@media (max-width:500px){.github-corner:hover .octo-arm{animation:none}.github-corner .octo-arm{animation:octocat-wave 560ms ease-in-out}}</style>
    
    <header id="header" class="header" itemscope itemtype="http://schema.org/WPHeader">
      <div class="header-inner"><div class="site-brand-wrapper">
  <div class="site-meta ">
    

    <div class="custom-logo-site-title">
      <a href="/"  class="brand" rel="start">
        <span class="logo-line-before"><i></i></span>
        <span class="site-title">Swift社区</span>
        <span class="logo-line-after"><i></i></span>
      </a>
    </div>
      
        <p class="site-subtitle">做最好的 Swift 社区</p>
      
  </div>

  <div class="site-nav-toggle">
    <button>
      <span class="btn-bar"></span>
      <span class="btn-bar"></span>
      <span class="btn-bar"></span>
    </button>
  </div>
</div>

<nav class="site-nav">
  

  
    <ul id="menu" class="menu">
      
        
        <li class="menu-item menu-item-home">
          <a href="/" rel="section">
            
              <i class="menu-item-icon fa fa-fw fa-home"></i> <br />
            
            首页
          </a>
        </li>
      
        
        <li class="menu-item menu-item-categories">
          <a href="/categories/" rel="section">
            
              <i class="menu-item-icon fa fa-fw fa-th"></i> <br />
            
            分类
          </a>
        </li>
      
        
        <li class="menu-item menu-item-tags">
          <a href="/tags/" rel="section">
            
              <i class="menu-item-icon fa fa-fw fa-tags"></i> <br />
            
            标签
          </a>
        </li>
      
        
        <li class="menu-item menu-item-about">
          <a href="/about/" rel="section">
            
              <i class="menu-item-icon fa fa-fw fa-user"></i> <br />
            
            关于
          </a>
        </li>
      
        
        <li class="menu-item menu-item-archives">
          <a href="/archives/" rel="section">
            
              <i class="menu-item-icon fa fa-fw fa-archive"></i> <br />
            
            归档
          </a>
        </li>
      

      
    </ul>
  

  
</nav>



 </div>
    </header>

    <main id="main" class="main">
      <div class="main-inner">
        <div class="content-wrap">
          <div id="content" class="content">
            

  <div id="posts" class="posts-expand">
    

  

  
  
  

  <article class="post post-type-normal" itemscope itemtype="http://schema.org/Article">
  
  
  
  <div class="post-block">
    <link itemprop="mainEntityOfPage" href="https://fanbaoying.github.io/Swift-周报-第四期/">

    <span hidden itemprop="author" itemscope itemtype="http://schema.org/Person">
      <meta itemprop="name" content="Swift社区">
      <meta itemprop="description" content="">
      <meta itemprop="image" content="https://avatars.githubusercontent.com/u/84354365?v=4">
    </span>

    <span hidden itemprop="publisher" itemscope itemtype="http://schema.org/Organization">
      <meta itemprop="name" content="Swift社区">
    </span>

    
      <header class="post-header">

        
        
          <h1 class="post-title" itemprop="name headline">Swift 周报 第四期</h1>
        

        <div class="post-meta">
          <span class="post-time">
            
              <span class="post-meta-item-icon">
                <i class="fa fa-calendar-o"></i>
              </span>
              
                <span class="post-meta-item-text">发表于</span>
              
              <time title="创建于" itemprop="dateCreated datePublished" datetime="2021-10-22T15:19:18+08:00">
                2021-10-22
              </time>
            

            

            
          </span>

          
            <span class="post-category" >
            
              <span class="post-meta-divider">|</span>
            
              <span class="post-meta-item-icon">
                <i class="fa fa-folder-o"></i>
              </span>
              
                <span class="post-meta-item-text">分类于</span>
              
              
                <span itemprop="about" itemscope itemtype="http://schema.org/Thing">
                  <a href="/categories/Swift-周报/" itemprop="url" rel="index">
                    <span itemprop="name">Swift 周报</span>
                  </a>
                </span>

                
                
              
            </span>
          

          
            
          

          
          

          

          
            <div class="post-wordcount">
              
                
                <span class="post-meta-item-icon">
                  <i class="fa fa-file-word-o"></i>
                </span>

                <!-- 
                  <span class="post-meta-item-text">字数统计&#58;</span>
                
                -->
                <span title="字数统计">
                  数字统计 2,476字
                </span>
              

              
                <span class="post-meta-divider">|</span>
              

              
                <span class="post-meta-item-icon">
                  <i class="fa fa-clock-o"></i>
                </span>

                <!-- 
                  <span class="post-meta-item-text">阅读时长 &asymp;</span>
                
                --> 

                <span title="阅读时长">
                  阅读时长 9分钟
                </span>
              
            </div>
          

          

        </div>
      </header>
    

    
    
    
    <div class="post-body" itemprop="articleBody">

      
      

      
        <p>周报仓库：<a href="https://github.com/SwiftCommunityRes" target="_blank" rel="noopener">https://github.com/SwiftCommunityRes</a></p>
<h2 id="前言"><a href="#前言" class="headerlink" title="前言"></a>前言</h2><p>最近 Swift.org 进行了一些非常好的改进，包括对 <code>dark mode</code> 的支持。 对于在 iOS 上使用 <code>dark mode</code> 的用户，该网站将自动切换模式以匹配。</p>
<blockquote>
<p>为了 Swift 社区周报持续稳定的发布更新，我们希望邀请 Swift 爱好者参与<strong>周报编辑</strong>，同时邀请赞助商对我们平台赞助支持。</p>
</blockquote>
<a id="more"></a>
<h2 id="入门任务"><a href="#入门任务" class="headerlink" title="入门任务"></a>入门任务</h2><p><strong>SR-15271</strong> [Compiler] <a href="https://bugs.swift.org/browse/SR-15271" title="Improve Codable Diagnostics When CodingKeys Do Not Match Properties" target="_blank" rel="noopener">当 CodingKeys 与属性不匹配时改进可编码诊断</a></p>
<h2 id="新闻和社区"><a href="#新闻和社区" class="headerlink" title="新闻和社区"></a>新闻和社区</h2><p><strong>Ted Kremenek</strong> 写了一篇关于 <a href="https://swift.org/blog/swift-5-5-released/" title="Swift 5.5 Released" target="_blank" rel="noopener">Swift 5.5 版本</a>的文章。</p>
<p><strong>Bruno Rocha</strong> 发表了一篇优秀的文章，解释了 <a href="https://swiftrocks.com/how-asyncsequence-works-internally-in-swift" title="How AsyncSequence works internally in Swift" target="_blank" rel="noopener">AsyncSequence 在 Swift 内部是如何工作</a>的。</p>
<p><strong>Lee Kah Seng</strong> 写了一篇文章，描述了 <a href="https://swiftsenpai.com/swift/actor-reentrancy-problem/" title="The Actor Reentrancy Problem in Swift" target="_blank" rel="noopener">Swift 中的 Actor Reentrancy 问题</a>。</p>
<p><strong>Amritpan Kaur</strong> 解释了她如何参与首届 <a href="https://forums.swift.org/t/swift-mentorship-compiler-language-design/52522" title="Swift Mentorship - Compiler &amp; Language Design" target="_blank" rel="noopener">Swift 导师，并致力于编译器开发和语言设计</a>。</p>
<h2 id="Commits-和-pull-requests"><a href="#Commits-和-pull-requests" class="headerlink" title="Commits 和 pull requests"></a>Commits 和 pull requests</h2><p><strong>Michael Ilseman</strong> 合并了一个为 <a href="https://github.com/apple/swift/pull/38922" title="[stdlib] Implement native normalization for String" target="_blank" rel="noopener">String 实现原生规范化</a>的 pull request。</p>
<p><strong>Doug Gregor</strong> 创建了一个 pull request，<a href="https://github.com/apple/swift/pull/39609" title="Back-deploy @objc actor types" target="_blank" rel="noopener">向后兼容  @objc actor 类型</a>。</p>
<h2 id="同意的提案"><a href="#同意的提案" class="headerlink" title="同意的提案"></a>同意的提案</h2><p><strong>SE-0322</strong> <a href="https://forums.swift.org/t/accepted-with-modifications-se-0322-temporary-uninitialized-buffers/52532" title="Temporary Uninitialized Buffers" target="_blank" rel="noopener">临时未初始化缓冲区</a>已接受修改。</p>
<p><strong>SE-0323</strong> <a href="https://forums.swift.org/t/accepted-se-0323-asynchronous-main-semantics/52531" title="Asynchronous Main Semantics" target="_blank" rel="noopener">Asynchronous Main 语义</a>已接受。</p>
<p><strong>SE-0324</strong> 接受了<a href="https://forums.swift.org/t/accepted-se-0324-relax-diagnostics-for-pointer-arguments-to-c-functions/52599" title="Relax diagnostics for pointer arguments to C functions" target="_blank" rel="noopener">对 C 函数的指针参数放宽诊断</a>提案。</p>
<h2 id="正在审查的提案"><a href="#正在审查的提案" class="headerlink" title="正在审查的提案"></a>正在审查的提案</h2><p><strong>SSWG-0017</strong>：<a href="https://forums.swift.org/t/sswg-0017-multipartkit/52586" title="MultipartKit" target="_blank" rel="noopener">MultipartKit</a> 正在审查中。</p>
<p><code>MultipartKit</code> 提供 <code>Multipart</code> 数据的低级解析和序列化，以及对 <code>Multipart</code> 表单数据的编码和解码的高级 <code>Codable</code> 支持。</p>
<h2 id="Swift-论坛"><a href="#Swift-论坛" class="headerlink" title="Swift 论坛"></a>Swift 论坛</h2><p><strong>1. Karoy Lorentey</strong> 询问什么时候将 <code>ManagedAtomic/UnsafeAtomic</code> 标记为 <code>Sendable</code>？</p>
<p>刚刚提交了<a href="https://github.com/apple/swift-atomics/issues/45" title="The constructs provided by this package need to be marked Sendable" target="_blank" rel="noopener">问题 #45</a>，要求将 <code>UnsafeAtomic</code>、<code>ManagedAtomic</code> 和朋友标记为 <code>Sendable</code>，这反映了它们可以安全地跨并发域传输。</p>
<p><strong>2. Kavon Farvardin</strong> 提议定义 <a href="https://forums.swift.org/t/proposal-actor-initializers-and-deinitializers/52322" title="[proposal] Actor Initializers and Deinitializers" target="_blank" rel="noopener">actor 初始化器</a>在 <code>Swift</code> 中的工作方式。</p>
<p>目前，本提案中描述的一些问题的建议解决方案通过警告反映在 <code>Swift 5.5</code> 中，但是审查 <code>Swift 6</code> 的这些更改很重要。此外，该提案为 <code>MainActor</code> 隔离类的 <code>deinit</code> 增加了额外的功能，这样可以更容易、更安全地编写。如果有新的想法和评论可以在<a href="https://github.com/kavon/swift-evolution/blob/actor-init-proposal2/proposals/nnnn-actor-initializers.md" title="Actor Initializers and Deinitializers" target="_blank" rel="noopener">这里提出来</a>。</p>
<p><strong>3. Kelvin Ma</strong> 发现 <a href="https://forums.swift.org/t/swift-5-5-has-serious-stack-corruption-bugs/52344" title="Swift 5.5 has serious stack corruption bugs!" target="_blank" rel="noopener">Swift 5.5 存在严重的堆栈损坏错误</a>。</p>
<p>我发现了几个与 async/await 相关的堆栈损坏错误，这些错误可以在使用最近的夜间工具链编译的简单测试程序中重现。 我已经确认 5.5-RELEASE 工具链中存在这些错误中的两个三四个。</p>
<p>我发现了几个与 <code>async/await</code> 相关的堆栈损坏错误，可以在 <code>recent nightly toolchains</code> 的简单测试程序中重现问题。<strong>我已确认 <code>5.5-RELEASE toolchain</code> 中存在多个错误</strong>。</p>
<p><strong>4. Becca Royal-Gordon</strong> 提出了在<a href="https://forums.swift.org/t/pitch-2-staging-in-sendable-checking/52413" title="Staging in Sendable checking" target="_blank" rel="noopener">Sendable 检查中添加暂存</a>的建议。</p>
<p>几周前，<strong>@Douglas_Gregor</strong> <a href="https://forums.swift.org/t/pitch-staging-in-sendable-checking/51341" title="[Pitch] Staging in Sendable checking" target="_blank" rel="noopener">提出了一些更改</a>，试图解决在一些客户端或依赖项可能尚未更新时在模块中采用 Sendable 检查所涉及的一些问题。当模块最终更新时，这种方法可能会出现问题和隐藏的 BUG，以及 <code>Objective-C</code> 库如何能够控制其类型的可发送性。</p>
<p><strong>5. YR Chen</strong> 开始讨论<a href="https://forums.swift.org/t/upon-swift-6-solve-inconsistency-within-the-language/52437" title="Upon Swift 6: Solve inconsistency within the language" target="_blank" rel="noopener">解决 Swift 6 发布时的不一致问题</a>。</p>
<p>一些 API 破损的语言设计可以在 3 年后 <code>Swift 6</code> 的发布中修复。这是一个相当长的时间，通过 <code>Swift 3.2</code> 和 <code>Swift 4.2</code> 事实证明，过渡到 Swift 突破性发布要顺畅的多。</p>
<p>建议我们选择一些延迟的断点，目的是消除语言中的不一致。这些想法已经得到了社区的积极反馈，但是还是没有开始实施。</p>
<p><strong>6. Philippe Hausler</strong> 提出了<a href="https://forums.swift.org/t/pitch-clock-instant-date-and-duration/52451" title="[Pitch] Clock, Instant, Date, and Duration" target="_blank" rel="noopener">定义 Clock, Instant, Date 和 Duration </a>的提案。</p>
<p><strong>时间的概念可以分为三个不同的部分：</strong></p>
<ul>
<li>提供现在概念的项目加上一个在给定时间点后醒来的方法，* 时间点的概念</li>
<li>时间测量的概念</li>
</ul>
<p>这三项分别是时钟、瞬间和持续时间。时间的测量可用于许多类型的 API，从高级网络连接超时概念到休眠任务的时间量。目前，测量时间类型的 API 采用 <code>NSTimeInterval</code> 又名 <code>TimeInterval</code>、<code>DispatchTimeInterval</code>，甚至像 <code>timespec</code> 这样的类型。</p>
<p><strong>7. Michael Ilseman</strong> 提出了<a href="https://forums.swift.org/t/declarative-string-processing-overview/52459" title="Declarative String Processing Overview" target="_blank" rel="noopener">实现声明性字符串处理</a> API 的想法。</p>
<p>字符串处理很困难，Swift 标准库目前提供的功能不足。我们建议添加两个新的声明性字符串处理 API，一个是熟悉的 <code>Regex</code> 文本，一个是更强大的 <code>Pattern</code> 结果生成器，以便 Swift 字符串处理起来更快速简便。</p>
<p>这是一个大型功能，最终将分为多个 <code>Swift Evolution</code> 提案。主要目的在于推动高级方向的讨论，并介绍该功能的关键点及其相互关系。</p>
<p><strong>8. Kelvin Ma</strong> 开始讨论<a href="https://forums.swift.org/t/we-need-long-term-support-lts-releases/52462" title="long-term-support (“LTS”) releases." target="_blank" rel="noopener">长期支持 (“LTS”) 版本</a>。</p>
<p>对于那些没有关注开发主题的人，@mickeyl，@timdecode，我最近在 <code>Swift 5.5</code> 发布工具链中发现了数量惊人的高危险的堆栈损坏 BUG。</p>
<p>撇开 <code>Swift 5.5</code> 中堆栈损坏问题的技术方面不谈，在我们发布周期中采用某种形式的<a href="https://forums.swift.org/t/we-need-long-term-support-lts-releases/52462" title="“Long-Term Support” (LTS) release 8 " target="_blank" rel="noopener">“长期支持”（LTS）版本8</a>的概念是否值得，就像 Ubuntu 一直以来所做的那样。</p>
<p><strong>9. Anders Bertelrud</strong> 提出了扩展插件 <a href="https://forums.swift.org/t/pitch-additional-api-available-to-swiftpm-plugins/52494" title="pitch additional api available to swiftpm plugins" target="_blank" rel="noopener">SwiftPM 插件 API </a>以提供更多上下文的提案。</p>
<p><code>SE-0303</code> 引入了 SwiftPM 插件，特别关注构建工具插件（尤其是那些生成源代码的插件）。为了保持该提案的界限，插件可用的信息类型和数量针对生成构建命令的任务。</p>
<p>在开始考虑新类型的插件之前，扩展所有类型插件可用的信息似乎是明智的。未来的提案可能会为特定类型的插件添加特定的 API，但在此之前，一个好的起点似乎是让所有插件访问 SwiftPM 内部已经拥有的包图的提炼形式。这应该允许任何特定插件有很大的自由度。</p>
<p>我提出一份提案草案，用于扩展可用于 SwiftPM 插件的 API，并且很想听听大家的想法。在 SwiftPM 存储库中的 PR 中有一个实现。</p>
<p><strong>10. Guillaume Lessard</strong> 提出了一项<a href="https://forums.swift.org/t/pitch-expand-usability-of-withmemoryrebound/52500" title="expand usability of withMemoryRebound" target="_blank" rel="noopener">扩大 withMemoryRebound 可用性</a>的提案。</p>
<p>函数 <code>withMemoryRebound(to:capacity:_ body:)</code> 执行一个闭包，同时将一定范围的内存临时绑定到与被调用者绑定的类型不同的类型。</p>
<p>我们建议解除 <code>withMemoryRebound</code> 的一些显着限制，并启用重新绑定到更大的类型集，以及从原始内存指针和缓冲区重新绑定。</p>
<p><strong>11. Tim Condon</strong> 向我们介绍了 <a href="https://forums.swift.org/t/async-await-and-the-future-of-vapor/52590" title="async/await and the future of Vapor." target="_blank" rel="noopener">async/await 和 Vapor 的未来</a>。</p>
<p><strong>12. Drew McCormack</strong> 提出了一项提案，该提案将创建用于<a href="https://forums.swift.org/t/proposal-a-standard-library-type-for-working-with-shared-data-in-a-concurrent-system/52603" title="standard library data structures designed for working with shared data in a concurrent system." target="_blank" rel="noopener">在并发系统中处理共享数据的标准库数据结构</a>。</p>
<p>我想在这里提出这样一种类型：分支资源。</p>
<p><code>BranchingResource</code> 将是一种类型，其携带的有效负载（即资源）具有通用参数。 资源将从单个分支开始，称为“<code>main</code>”或“<code>trunk</code>”或“<code>truth</code>”。 该应用程序可以添加任意数量的辅助命名分支。</p>
<p><strong>13. Pavel Yaskevich</strong> 提出了<a href="https://forums.swift.org/t/pitch-enable-multi-statement-closure-parameter-result-type-inference/52619" title="enable multi-statement closure parameter/result type" target="_blank" rel="noopener">启用 multi-statement closure parameter/result type 推断</a>的想法。</p>
<p>我建议通过从闭包主体中启用参数和结果类型推断来改进多语句闭包的推理行为。</p>
<p>这将使开发人员的类型推断不那么令人惊讶，并消除了在闭包中添加多一个表达式或语句可能会导致编译失败的问题。</p>
<h2 id="推荐博文"><a href="#推荐博文" class="headerlink" title="推荐博文"></a>推荐博文</h2><h3 id="iOS-系列"><a href="#iOS-系列" class="headerlink" title="iOS 系列"></a>iOS 系列</h3><p><a href="https://mp.weixin.qq.com/s/ZprPxK8NbMqpP9flmWRagg" target="_blank" rel="noopener">百度一面总结（含答案）</a></p>
<p><a href="https://mp.weixin.qq.com/s/PYzQN5HYXLU1JuXBAZNyhQ" target="_blank" rel="noopener">使用 Swift 实现 Promise</a></p>
<p>我最近在找如何使用 Swift 实现 <code>Promise</code> 的资料，因为没找到好的文章，所以我想自己写一篇。通过本文，我们将实现自己的 <code>Promise</code> 类型，以便明了其背后的逻辑。</p>
<p><a href="https://mp.weixin.qq.com/s/8_utYi3y7I3ukh4VpnIM3A" target="_blank" rel="noopener">用 Swift 实现轻量的属性监听系统</a></p>
<p>本文的主要目的是解决客户端开发中对“模型的一处修改，UI 要多处更新”的问题。当然，我们要知晓解决方案的细节和思考过程，以及看到其能达到的效果。我们会用到函数式编程的思想，以及伟大的“泛型”。</p>
<h3 id="SwiftUI-系列"><a href="#SwiftUI-系列" class="headerlink" title="SwiftUI 系列"></a>SwiftUI 系列</h3><p><a href="https://mp.weixin.qq.com/s/hfe1m5bNiA0DzdFTEvi9sQ" target="_blank" rel="noopener">用 SwiftUI 实现 3D Scroll 效果</a></p>
<p>学完本教程后，你就可以在你的 App 中把这种 <code>3D</code> 效果加入任何自定义的 SwiftUI 视图。</p>
<p><a href="https://mp.weixin.qq.com/s/TD0I96HSUoTNmOmfySCtYQ" target="_blank" rel="noopener">如何让 SwiftUI 的列表变得更加灵活</a></p>
<p><code>List</code> 可能是 <code>SwiftUI</code> 附带的内置视图中最常用的一种，它使我们能够在任何 <code>Apple</code> 平台上呈现“类似于表格视图”的用户界面。今年，<code>List</code> 获得了许多非常重要的升级，使其更加灵活和易于定制。让我们看看都有哪些新功能。</p>
<p><a href="https://mp.weixin.qq.com/s/snJJi9KYViFErdJAP1HEPQ" target="_blank" rel="noopener">使用 SwiftUI 创建万花尺</a></p>
<p>为了完成一些真正意义上的绘图工作，我将带您通过创建一个简单的带 SwiftUI 的 <code>spirograph</code>。“Spirograph”是一种玩具的商标名称，你把一支铅笔放在一个圆圈里，然后绕着另一个圆圈的圆周旋转，创造出各种几何图案，称为轮盘赌——就像赌场游戏一样。</p>
<h2 id="关于我们"><a href="#关于我们" class="headerlink" title="关于我们"></a>关于我们</h2><p>公众号是由 Swift 爱好者共同维护，我们会分享以 Swift 实战、SwiftUI、Swift 基础为核心的技术内容，也整理收集优秀的学习资料。欢迎关注公众号：<strong>Swift社区</strong>，后台点击进群，联系我们获取更多内容。</p>
<p><img width="500" alt="Swift社区" src="https://user-images.githubusercontent.com/24238160/132703149-34121c6c-fd18-491c-a697-58a0fabf3060.png"></p>
<p>感谢 SwiftWeekly 与我们的合作，开启 Swift 周报中文版发布之旅。周报仓库：<a href="https://github.com/SwiftCommunityRes" target="_blank" rel="noopener">https://github.com/SwiftCommunityRes</a></p>
<p>后续还会翻译大量资料到我们公众号，有感兴趣的朋友，可以加入我们，扫码添加微信</p>
<p><img width="300" alt="fzhanfei" src="https://files.mdnice.com/user/17787/9a7911bf-75f2-40f5-866b-3171868bb92c.jpg"></p>

      
    </div>
    
    
    
    

    
      <div>
        <div>
    
        <div style="text-align:center;color: #ccc;font-size:14px;">-------------本文结束<i class="fa fa-paw"></i>感谢您的阅读-------------</div>
    
</div>

      </div>
    


    
      <div>
        
<div class="my_post_copyright">
  <script src="//cdn.bootcss.com/clipboard.js/1.5.10/clipboard.min.js"></script>

  <!-- JS库 sweetalert 可修改路径 -->
  <script src="https://cdn.bootcss.com/jquery/2.0.0/jquery.min.js"></script>
  <script src="https://unpkg.com/sweetalert/dist/sweetalert.min.js"></script>
  <p><span>本文标题:</span><a href="/Swift-周报-第四期/">Swift 周报 第四期</a></p>
  <p><span>文章作者:</span><a href="/" title="访问 Swift社区 的个人博客">Swift社区</a></p>
  <p><span>发布时间:</span>2021年10月22日 - 15:10</p>
  <p><span>最后更新:</span>2021年10月22日 - 15:10</p>
  <p><span>原始链接:</span><a href="/Swift-周报-第四期/" title="Swift 周报 第四期">https://fanbaoying.github.io/Swift-周报-第四期/</a>
    <span class="copy-path"  title="点击复制文章链接"><i class="fa fa-clipboard" data-clipboard-text="https://fanbaoying.github.io/Swift-周报-第四期/"  aria-label="复制成功！"></i></span>
  </p>
  <p><span>许可协议:</span><i class="fa fa-creative-commons"></i> <a rel="license" href="https://creativecommons.org/licenses/by-nc-nd/4.0/" target="_blank" title="Attribution-NonCommercial-NoDerivatives 4.0 International (CC BY-NC-ND 4.0)">署名-非商业性使用-禁止演绎 4.0 国际</a> 转载请保留原文链接及作者。</p>  
</div>
<script> 
    var clipboard = new Clipboard('.fa-clipboard');
      $(".fa-clipboard").click(function(){
      clipboard.on('success', function(){
        swal({   
          title: "",   
          text: '复制成功',
          icon: "success", 
          showConfirmButton: true
          });
        });
    });  
</script>

      </div>
    


    

    
      <div>
        <div style="padding: 10px 0; margin: 20px auto; width: 90%; text-align: center;">
  <div>坚持原创技术分享，您的支持将鼓励我继续创作！</div>
  <button id="rewardButton" disable="enable" onclick="var qr = document.getElementById('QR'); if (qr.style.display === 'none') {qr.style.display='block';} else {qr.style.display='none'}">
    <span>打赏</span>
  </button>
  <div id="QR" style="display: none;">

    
      <div id="wechat" style="display: inline-block">
        <img id="wechat_qr" src="/images/wechat.png" alt="Swift社区 微信支付"/>
        <p>微信支付</p>
      </div>
    

    
      <div id="alipay" style="display: inline-block">
        <img id="alipay_qr" src="/images/alipay.png" alt="Swift社区 支付宝"/>
        <p>支付宝</p>
      </div>
    

    

  </div>
</div>

      </div>
    

    

    <footer class="post-footer">
      
        <div class="post-tags">
          
            <a href="/tags/Swift/" rel="tag"><i class="fa fa-tag"></i> Swift</a>
          
        </div>
      

      
      
      

      
        <div class="post-nav">
          <div class="post-nav-next post-nav-item">
            
              <a href="/Swift-周报-第三期/" rel="next" title="Swift 周报 第三期">
                <i class="fa fa-chevron-left"></i> Swift 周报 第三期
              </a>
            
          </div>

          <span class="post-nav-divider"></span>

          <div class="post-nav-prev post-nav-item">
            
              <a href="/Swift-周报-第六期/" rel="prev" title="Swift 周报 第六期">
                Swift 周报 第六期 <i class="fa fa-chevron-right"></i>
              </a>
            
          </div>
        </div>
      

      
      
    </footer>
  </div>
  
  
  
  </article>



    <div class="post-spread">
      
        <!-- JiaThis Button BEGIN -->
<div class="jiathis_style">
<span class="jiathis_txt">分享到：</span>
<a class="jiathis_button_fav">收藏夹</a>
<a class="jiathis_button_copy">复制网址</a>
<a class="jiathis_button_email">邮件</a>
<a class="jiathis_button_weixin">微信</a>
<a class="jiathis_button_qzone">QQ空间</a>
<a class="jiathis_button_tqq">腾讯微博</a>
<a class="jiathis_button_douban">豆瓣</a>
<a class="jiathis_button_share">一键分享</a>

<a href="http://www.jiathis.com/share?uid=2140465" class="jiathis jiathis_txt jiathis_separator jtico jtico_jiathis" target="_blank">更多</a>
<a class="jiathis_counter_style"></a>
</div>
<script type="text/javascript" >
var jiathis_config={
  data_track_clickback:true,
  summary:"",
  shortUrl:false,
  hideMore:false
}
</script>
<script type="text/javascript" src="http://v3.jiathis.com/code/jia.js?uid=" charset="utf-8"></script>
<!-- JiaThis Button END -->
      
    </div>
  </div>


          </div>
          


          

  



        </div>
        
          
  
  <div class="sidebar-toggle">
    <div class="sidebar-toggle-line-wrap">
      <span class="sidebar-toggle-line sidebar-toggle-line-first"></span>
      <span class="sidebar-toggle-line sidebar-toggle-line-middle"></span>
      <span class="sidebar-toggle-line sidebar-toggle-line-last"></span>
    </div>
  </div>

  <aside id="sidebar" class="sidebar">
    
    <div class="sidebar-inner">

      

      
        <ul class="sidebar-nav motion-element">
          <li class="sidebar-nav-toc sidebar-nav-active" data-target="post-toc-wrap">
            文章目录
          </li>
          <li class="sidebar-nav-overview" data-target="site-overview-wrap">
            站点概览
          </li>
        </ul>
      

      <section class="site-overview-wrap sidebar-panel">
        <div class="site-overview">
          <div class="site-author motion-element" itemprop="author" itemscope itemtype="http://schema.org/Person">
            
              <img class="site-author-image" itemprop="image"
                src="https://avatars.githubusercontent.com/u/84354365?v=4"
                alt="Swift社区" />
            
              <p class="site-author-name" itemprop="name">Swift社区</p>
              <p class="site-description motion-element" itemprop="description">我们的使命是做一个最专业最权威的 Swift 中文社区，我们的愿景是希望更多的人学习和使用Swift。我们会分享以 Swift 实战、SwiftUI、Swift 基础为核心的技术干货，不忘初心，牢记使命。</p>
          </div>

          <nav class="site-state motion-element">

            
              <div class="site-state-item site-state-posts">
              
                <a href="/archives/">
              
                  <span class="site-state-item-count">187</span>
                  <span class="site-state-item-name">日志</span>
                </a>
              </div>
            

            
              
              
              <div class="site-state-item site-state-categories">
                <a href="/categories/index.html">
                  <span class="site-state-item-count">19</span>
                  <span class="site-state-item-name">分类</span>
                </a>
              </div>
            

            
              
              
              <div class="site-state-item site-state-tags">
                <a href="/tags/index.html">
                  <span class="site-state-item-count">11</span>
                  <span class="site-state-item-name">标签</span>
                </a>
              </div>
            

          </nav>

          
            <div class="feed-link motion-element">
              <a href="/atom.xml" rel="alternate">
                <i class="fa fa-rss"></i>
                RSS
              </a>
            </div>
          

          
            <div class="links-of-author motion-element">
                
                  <span class="links-of-author-item">
                    <a href="https://blog.csdn.net/qq_36478920" target="_blank" title="CSDN">
                      
                        <i class="fa fa-fw fa-heartbeat"></i>CSDN</a>
                  </span>
                
                  <span class="links-of-author-item">
                    <a href="https://juejin.im/user/5a30d987f265da430d580126" target="_blank" title="掘金">
                      
                        <i class="fa fa-fw fa-spinner"></i>掘金</a>
                  </span>
                
                  <span class="links-of-author-item">
                    <a href="https://github.com/fanbaoying" target="_blank" title="GitHub">
                      
                        <i class="fa fa-fw fa-github"></i>GitHub</a>
                  </span>
                
                  <span class="links-of-author-item">
                    <a href="https://www.zhihu.com/people/swift-community" target="_blank" title="知乎">
                      
                        <i class="fa fa-fw fa-heartbeat"></i>知乎</a>
                  </span>
                
                  <span class="links-of-author-item">
                    <a href="https://weibo.com/u/7711465033" target="_blank" title="微博">
                      
                        <i class="fa fa-fw fa-weibo"></i>微博</a>
                  </span>
                
                  <span class="links-of-author-item">
                    <a href="https://mp.weixin.qq.com/mp/appmsgalbum?__biz=MzAxNzgzNTgwMw==&action=getalbum&album_id=2024314764775981057" target="_blank" title="公众号">
                      
                        <i class="fa fa-fw fa-heartbeat"></i>公众号</a>
                  </span>
                
            </div>
          

          
          

          
          
            <div class="links-of-blogroll motion-element links-of-blogroll-block">
              <div class="links-of-blogroll-title">
                <i class="fa  fa-fw fa-link"></i>
                友情链接
              </div>
              <ul class="links-of-blogroll-list">
                
                  <li class="links-of-blogroll-item">
                    <a href="https://github.com/SwiftCommunityRes/SwiftWeekly" title="SwiftWeekly" target="_blank">SwiftWeekly</a>
                  </li>
                
                  <li class="links-of-blogroll-item">
                    <a href="https://github.com/SwiftCommunityRes/article-ios" title="Article-ios" target="_blank">Article-ios</a>
                  </li>
                
                  <li class="links-of-blogroll-item">
                    <a href="https://github.com/SwiftCommunityRes/SwiftUI-Book" title="SwiftUI-Book" target="_blank">SwiftUI-Book</a>
                  </li>
                
              </ul>
            </div>
          

          

        </div>
      </section>

      
      <!--noindex-->
        <section class="post-toc-wrap motion-element sidebar-panel sidebar-panel-active">
          <div class="post-toc">

            
              
            

            
              <div class="post-toc-content"><ol class="nav"><li class="nav-item nav-level-2"><a class="nav-link" href="#前言"><span class="nav-number">1.</span> <span class="nav-text">前言</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#入门任务"><span class="nav-number">2.</span> <span class="nav-text">入门任务</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#新闻和社区"><span class="nav-number">3.</span> <span class="nav-text">新闻和社区</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#Commits-和-pull-requests"><span class="nav-number">4.</span> <span class="nav-text">Commits 和 pull requests</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#同意的提案"><span class="nav-number">5.</span> <span class="nav-text">同意的提案</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#正在审查的提案"><span class="nav-number">6.</span> <span class="nav-text">正在审查的提案</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#Swift-论坛"><span class="nav-number">7.</span> <span class="nav-text">Swift 论坛</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#推荐博文"><span class="nav-number">8.</span> <span class="nav-text">推荐博文</span></a><ol class="nav-child"><li class="nav-item nav-level-3"><a class="nav-link" href="#iOS-系列"><span class="nav-number">8.1.</span> <span class="nav-text">iOS 系列</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#SwiftUI-系列"><span class="nav-number">8.2.</span> <span class="nav-text">SwiftUI 系列</span></a></li></ol></li><li class="nav-item nav-level-2"><a class="nav-link" href="#关于我们"><span class="nav-number">9.</span> <span class="nav-text">关于我们</span></a></li></ol></div>
            

          </div>
        </section>
      <!--/noindex-->
      

      

    </div>
  </aside>


        
      </div>
    </main>

    <footer id="footer" class="footer">
      <div class="footer-inner">
        
<script async src="//busuanzi.ibruce.info/busuanzi/2.3/busuanzi.pure.mini.js"></script>
<div class="copyright">&copy; <span itemprop="copyrightYear">2024</span>
  <span class="with-love">
    <i class="fa fa-user"></i>
  </span>
  <span class="author" itemprop="copyrightHolder">Swift社区</span>

  
</div>

<!-- 
<div class="powered-by">
  <i class="fa fa-user-md">
  </i>
  <span id="busuanzi_container_site_uv">
    已有<span id="busuanzi_value_site_uv"></span>人来访
  </span>

</div>


  <span class="post-meta-divider">|</span>


<div class="powered-by">
  <i class="fa fa-eye"></i>
  <span id="busuanzi_container_site_pv">
      访问量<span id="busuanzi_value_site_pv"></span>次
  </span>
</div>



  <span class="post-meta-divider">|</span>


-->

<div class="theme-info">
  <i class="fa fa-pencil"></i>
  <span class="post-count">博客全站共361.6k字</span>
</div>


<!-- 
  <span class="post-meta-divider">|</span>



  <div class="powered-by">由 <a class="theme-link" target="_blank" href="https://hexo.io">Hexo</a> 强力驱动</div>



  <span class="post-meta-divider">|</span>



  <div class="theme-info">主题 &mdash; <a class="theme-link" target="_blank" href="https://github.com/iissnan/hexo-theme-next">NexT.Pisces</a> v5.1.4</div>



-->

        







        
      </div>
    </footer>

    
      <div class="back-to-top">
        <i class="fa fa-arrow-up"></i>
        
      </div>
    

    

  </div>

  

<script type="text/javascript">
  if (Object.prototype.toString.call(window.Promise) !== '[object Function]') {
    window.Promise = null;
  }
</script>









  












  
  
    <script type="text/javascript" src="/lib/jquery/index.js?v=2.1.3"></script>
  

  
  
    <script type="text/javascript" src="/lib/fastclick/lib/fastclick.min.js?v=1.0.6"></script>
  

  
  
    <script type="text/javascript" src="/lib/jquery_lazyload/jquery.lazyload.js?v=1.9.7"></script>
  

  
  
    <script type="text/javascript" src="/lib/velocity/velocity.min.js?v=1.2.1"></script>
  

  
  
    <script type="text/javascript" src="/lib/velocity/velocity.ui.min.js?v=1.2.1"></script>
  

  
  
    <script type="text/javascript" src="/lib/fancybox/source/jquery.fancybox.pack.js?v=2.1.5"></script>
  


  


  <script type="text/javascript" src="/js/src/utils.js?v=5.1.4"></script>

  <script type="text/javascript" src="/js/src/motion.js?v=5.1.4"></script>



  
  


  <script type="text/javascript" src="/js/src/affix.js?v=5.1.4"></script>

  <script type="text/javascript" src="/js/src/schemes/pisces.js?v=5.1.4"></script>



  
  <script type="text/javascript" src="/js/src/scrollspy.js?v=5.1.4"></script>
<script type="text/javascript" src="/js/src/post-details.js?v=5.1.4"></script>



  


  <script type="text/javascript" src="/js/src/bootstrap.js?v=5.1.4"></script>



  


  




	





  





  












  





  

  

  

  
  

  

  

  

</body>
</html>
